namespace KYO.DAL {
    using System;
    using System.Text;
    using System.Collections;
    using System.Collections.Generic;
    
    public partial class User : ObjectPersistence.ORNetBaseType {
        public User() {
        }
        public User(string FullName, string ImageUrl, string Password, string Username) {
            this.FullName = FullName;
            this.ImageUrl = ImageUrl;
            this.Password = Password;
            this.Username = Username;
        }
        public User(int UserID, string FullName, string ImageUrl, string Password, string Username) {
            this.UserID = UserID;
            this.FullName = FullName;
            this.ImageUrl = ImageUrl;
            this.Password = Password;
            this.Username = Username;
        }

        public int UserID {
            get {
                return _UserID;
            }
            set {
                this._UserID = value;
                this.ChangesMade = true;
            }
        }
        public string FullName {
            get {
                return _FullName;
            }
            set {
                this._FullName = value;
                this.ChangesMade = true;
            }
        }
        public string ImageUrl {
            get {
                return _ImageUrl;
            }
            set {
                this._ImageUrl = value;
                this.ChangesMade = true;
            }
        }
        public string Password {
            get {
                return _Password;
            }
            set {
                this._Password = value;
                this.ChangesMade = true;
            }
        }
        public string Username {
            get {
                return _Username;
            }
            set {
                this._Username = value;
                this.ChangesMade = true;
            }
        }


        public BusinessLayerHelper.PersistentList<KYO.DAL.Role> RoleColl {
            get {
                if ((_RoleColl == null)) {
                    if (IsNew) {
                        _RoleColl = new BusinessLayerHelper.PersistentList<KYO.DAL.Role>();
                    }
                    else {
                        ObjectPersistence.UserAssembler _tempAssem = new ObjectPersistence.UserAssembler();
                        _RoleColl = _tempAssem.GetRoleColl(UserID);
                    }
                }
                return _RoleColl;
            }
            set {
                this._RoleColl = value;
            }
        }


        private int _UserID;
        private string _FullName;
        private string _ImageUrl;
        private string _Password;
        private string _Username;
        private BusinessLayerHelper.PersistentList<KYO.DAL.Role> _RoleColl;


        public bool IsRoleCollNull() {
            return (this._RoleColl == null);
        }
        public string ROKeyString {
            get {
                return ("KYO.DAL.User" + UserID.ToString());
            }
        }

    }
}
